<?php
include('../config.php');
$username = $_POST['username'];
$pwd = $_POST['pwd'];

// echo $username;
// echo $pwd;
$sql = "select * from users where username='$username' and password='$pwd'";
$res = mysql_query($sql);
$len = mysql_num_rows($res);
// echo $len;
if($len > 0){
    echo json_encode(array(
        "code" => 200,
        "body" => array(
            "msg" => "登录成功"
        )
        ));
}else{
    echo json_encode(array(
        "code" => 400,
        "body" => array(
            "msg" => "登录失败，密码或账号错误"
        )
        ));
}
?>